/**
 * 
 */
package com.RHECmap.com;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * @author Harsha
 *
 */
public class Preferece {
	
	//initiate the preference
	
		private static SharedPreferences getPref(Context context){
			
			return context.getSharedPreferences("myPref",0);
			
		}
		
		//this method for retrive string values
		
		public static String getMyStringPref(Context context,String key){
			
			return getPref(context).getString(key, "default");	
			
		}
		
		//this method for retrive integer values

		public static int getMyIntPref(Context context,String key){
			
			return getPref(context).getInt(key,0); //if no value stored it retruns 0
		}
		
		//this method for store string values
		
		public static void setMyString(Context context,String key,String value){
			
			getPref(context).edit().putString(key, value).commit();
		}
		
		
		//this method for store string values
	public static void setMyInt(Context context,String key,int value){
			
			getPref(context).edit().putInt(key, value).commit();
		}
		
	

}
